$header-height: 2rem;
$statusbar-height: 1.5rem;
$tab-container-height: 2rem;

html {
    background-color: var(--window-background);
    color: var(--window-foreground);
}
#handle, #header {
    height: $header-height;
}
#statusbar {
    border-top: solid 1px var(--window-borderColor);
    height: calc($statusbar-height + 0.1rem);
    color: var(--statusbar-foreground);
    background-color: var(--statusbar-background);
    .tool:hover {
        background-color: var(--statusbar-buttonBackgroundHover);
        color: var(--statusbar-buttonForegroundHover);
    }
}
#workspace {
    line-height: $header-height;
}
#header {
    background-color: var(--header-background);
    box-shadow: var(--header-borderColor) 0px 1.5px 0px;
}
.window-button:not(.close):hover {
    background-color: var(--header-buttonHoverBackground);
}
.menu-button {
    &:hover {
        background-color: var(--header-buttonHoverBackground);
    }
    &.open {
        background-color: var(--header-buttonHoverBackground);
    }
}
.menu-list, .context-menu {
    background-color: var(--window-menuBackground);
    box-shadow: 0 2px 6px var(--window-boxShadow);
}
.menu-item, .context-menu-option {
    color: var(--window-foreground);
    &:hover {
        background-color:  var(--window-menuItemHoverBackground);
    }
}
.select {
    button {
        background-color: var(--window-selectButtonBackground);
        color: var(--window-selectButtonForeground);
    }
    .item-list {
        border: 1px solid #333;
        background-color: var(--window-selectBackground);
        .item:hover {
            background-color: var(--window-selectItemHoverBackground);
            color: var(--window-selectItemHoverForeground);
        }
    }
}
.option-shortcut, .shortcut {
    color: var(--window-menuShortcutForeground);
}
.disabled {
    color: var(--window-disabledTextForeground);
}
.invalid {
    color: var(--window-invalidTextForeground);
}
.readonly {
    color: var(--window-readonlyTextForeground);
}
.link {
    color: var(--window-linkForeground);
    &:hover {
        color: var(--window-linkHoverForeground);
    }
}
.desc {
    color: var(--window-descriptionForeground);
}

label {
    color: var(--window-inputLabelForeground);
}
input {
    border-bottom: 1px solid var(--window-inputBorder) !important;
    background-color: var(--window-inputBackground);
    color: var(--window-inputForeground);
    &.invalid {
        border-bottom: 1px solid #fa4d56 !important;
    }
    &:focus{
        border-bottom: 1px solid var(--window-inputFocusBorder) !important;
    }
}
button {
    &.primary {
        background-color: var(--window-buttonBackground);
        color: var(--window-buttonForeground);
        &:hover {
            background-color: var(--window-buttonHoverBackground);
            color: var(--window-buttonHoverForeground);
        }
    }
    &.secondary {
        background-color: var(--window-buttonSecondaryBackground);
        color: var(--window-buttonSecondaryForeground);
        &:hover {
            background-color: var(--window-buttonSecondaryHoverBackground);
            color: var(--window-buttonSecondaryHoverForeground);
        }
    }
    &.accent {
        background-color: var(--window-buttonAccentBackground);
        color: var(--window-buttonAccentForeground);
        &:hover {
            background-color: var(--window-buttonAccentHoverBackground);
            color: var(--window-buttonHoverAccentForeground);
        }
    }
    &.danger {
        background-color: var(--window-buttonDangerBackground);
        color: var(--window-buttonDangerForeground);
        &:hover {
            background-color: var(--window-buttonDangerHoverBackground);
            color: var(--window-buttonDangerHoverForeground);
        }
    }
}
button:focus {
    outline: 1px solid;
    outline-offset: 0px;
}

.divider {
    background-color: var(--window-borderColor);
}

#main {
    height: calc(100vh - $header-height - $statusbar-height - 0.063rem * 2);
}
#main.fullscreen {
    height: calc(100vh - $header-height + 0.4rem) !important;
}

#sidebar {
    border-right: 1px solid var(--window-borderColor);
}

#sidebarview {
    #tool-view .toolbar-button {
        background-color: var(--window-buttonBackground);
        color: var(--window-buttonForeground);
        &:hover {
            background-color: var(--window-buttonHoverBackground);
            color: var(--window-buttonHoverForeground);
        }
    }
}

.sidebar-tab {
    &.active {
        box-shadow: inset 3.5px 0px 0 0 var(--sidebar-tabActiveBorder);
        background-color: var(--sidebar-tabActiveBackground);
        color: var(--sidebar-tabActiveForeground);
    }
    &:hover {
        background-color:  var(--sidebar-tabHoverBackground);
    }
}

.editor-panes .splitpanes__splitter {
    background-color: var(--window-borderColor);
}

.tree {
    color: var(--filetree-treeNodeForeground);
    .hover {
        background-color: var(--header-background) !important;   
    }
    .tree-label {
        svg {
            color: var(--window-foreground);
        }
        &:hover {
            color: var(--filetree-treeNodeHoverForeground);
            background-color: var(--filetree-treeNodeHoverBackground);
        }
        &.selected {
            color: var(--filetree-treeNodeSelectedForeground);
            background-color: var(--filetree-treeNodeSelectedBackground);
        }
    }
}

#editor-tabs {
    background-color: var(--header-background);
    color: var(--header-foreground);
    height: calc($tab-container-height + 5px);
    box-shadow: inset 0px -1px 0 0 var(--window-borderColor);

    .tab {
        background-color: var(--editor-tabBackground);
        color: var(--editor-tabForeground);
        box-shadow: inset 0px -1px 0 0 var(--editor-tabBorderColor);
        &:not(.active):hover {
            background-color: var(--editor-tabHoverBackground);
            color: var(--editor-tabHoverForeground);
        }
        &.active {
            background-color: var(--editor-tabActiveBackground);
            box-shadow: inset 0px 5px 0 0 var(--editor-tabActiveBorderColor) !important;
            color: var(--editor-tabActiveForeground);
        }
    }
    .close-tab span:hover {
        background-color: var(--editor-tabBorderColor);
    }
    .tab-content .save-state {
        background-color: var(--editor-tabSaveStateColor);
    }
    .tab-toolbar {
        box-shadow: inset 1px 0px 0 0 var(--window-borderColor);
    }
}

#tabview {
    height: calc(100% - 2.3rem);
    &>div:not(.editor) {
        background-color: var(--window-background);
    }
    >.container svg {
        color: var(--window-accent);
    }
}

.settings {
    .heading::after {
        background-color: var(--window-borderColor);
    }
}
.settings-directory {
    border-right: 0.5px solid var(--window-borderColor);
}

.rename-input .divider {
    background-color: var(--window-inputBorder);
}

.popup-wrapper {
    background-color: var(--modal-shadow);
    .popup-container {
        background-color: var(--modal-background);
        color: var(--modal-foreground);
        button {
            &:first-child {
                background-color: var(--modal-buttonBackground) !important;
                color: var(--modal-buttonForeground) !important;
                &:hover {
                    background-color: var(--modal-buttonHoverBackground) !important;
                    color: var(--modal-buttonHoverForeground) !important;
                }
            }
            background-color: var(--window-buttonSecondaryBackground);
            color: var(--window-buttonSecondaryForeground);
            &:hover {
                background-color: var(--window-buttonSecondaryHoverBackground);
                color: var(--window-buttonSecondaryHoverForeground);
            }
            &:focus {
                outline-color: var(--window-inputFocusBorder);
            }
        }
    }
}

#toolview {
    .header {
        border-bottom: solid 1px var(--window-borderColor);
        color: var(--statusbar-foreground);
        .tool-buttons > div {
            &:hover {
                background-color: var(--statusbar-buttonBackgroundHover);
                color: var(--statusbar-buttonForegroundHover);
            }
        }
        .close {
            &:hover {
                background-color: var(--statusbar-buttonBackgroundHover);
                color: var(--statusbar-buttonForegroundHover);
            }
        }
    }
}

#terminal {
    background-color: var(--terminal-background);
    color: var(--terminal-foreground);
}
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    background-color: transparent;
}
::-webkit-scrollbar-corner {
    background-color: transparent;
}
::-webkit-scrollbar-thumb {
    border-radius: 20px;
    background-color: var(--window-scrollbarBackground);
    &:hover {
        background-color: #1b83ddb5;
    }
}

.notification, .notification-toast {
    background-color: var(--notification-background);
    border-top: 3px solid var(--notification-defaultBorderColor);
    color: var(--notification-foreground);
    &.read {
        border-top-color: var(--notification-unreadBorderColor) !important;
        color: var(--notification-unreadColor);
        .icon {
            color: var(--notification-unreadBorderColor) !important;
        }
        .message {
            color: var(--notification-unreadBorderColor);
        }
    }
    .details .icon {
        color: var(--notification-defaultBorderColor);
    }
    &::before {
        border-color: var(--window-inputBackground);
    }
    .action-button {
        color: var(--notification-actionButtonColor);
    }
}
.notification-toast {
    box-shadow: 0 2px 6px var(--window-boxShadow);
}

.editor-panes .splitpanes__splitter::before {
    background-color: var(--window-panelBorderColor);
}